package com.xiaobai.model.convertor.system;

import com.xiaobai.model.entity.system.Menu;
import com.xiaobai.model.vo.system.menu.MenuAddVO;
import com.xiaobai.model.vo.system.menu.MenuTreeVO;
import com.xiaobai.model.vo.system.menu.MenuUpdateVO;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
public interface MenuConvertor {

    MenuConvertor INSTANCE = Mappers.getMapper(MenuConvertor.class);

    Menu toAddEntity(MenuAddVO menuAddVO);

    Menu toUpdateEntity(MenuUpdateVO menuUpdateVO);

    MenuTreeVO toTreeVO(Menu menu);

    List<MenuTreeVO> toTreeVOList(List<Menu> menuList);

}
